#include "Thread.hpp"
#include <iostream>
#include <unistd.h>
#include <memory>
#include <string>
using namespace std;

void* start_routine(void* args)
{
    string str = static_cast<const char*>(args);
    int cnt = 5;
    while(cnt--)
    {
        cout << str << " is running..." << endl;
        sleep(1);
    }
}
int main()
{

    unique_ptr<Thread> thread1(new Thread(start_routine, (void*)"hello Thread", 1));
    unique_ptr<Thread> thread2(new Thread(start_routine, (void*)"count Thread", 2));
    unique_ptr<Thread> thread3(new Thread(start_routine, (void*)"log Thread", 3));

    thread1->join();
    thread2->join();
    thread3->join();


    return 0;
}